import requests
import time

start_id = 44030700001320000010
end_id = 44030700001320000500

while start_id <= end_id:
    start_url = f"https://wvp.soft.cowarobot.com/api/play/start/{start_id}/{start_id}"
    headers = {
        "access-token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjNlNzk2NDZjNGRiYzQwODM4M2E5ZWVkMDlmMmI4NWFlIn0.eyJqdGkiOiI1WWg5VVJpR1dRYTR0dkJfTmxMczdnIiwiaWF0IjoxNzUxMjcxODU3LCJleHAiOjE3NTM4NjM4NTcsIm5iZiI6MTc1MTI3MTg1Nywic3ViIjoibG9naW4iLCJhdWQiOiJBdWRpZW5jZSIsInVzZXJOYW1lIjoiYWRtaW4ifQ.mKK_urqEdg7v2lqbJK9_SBubWZwKRV4P3-_YyvlnVMtFr8NRhVru8hLwpu1DWICZ1N-FP5JLkHA_DarkM-hBfVocp-2ppLR3Y3-eGctmrZoj4YRpXq890TNUVxoejV6rAqIMqtFEQkNhf5EYnB6FbdFc0-YacJscgwMgG3K6ajc1PuT_x1VawC9kJr7yOl3X2EWpxc3bbGNSH30leY4Ij5yp8A0Whr5C-jh-TzO5aEssCYu7-j9felkwTtdx97Byo464wjmF_FVBcGHF5Wt353EW4_5ElpC9Z6MufBeHcASvfUkZ7nlKALH4LNlVzSQfnjDKzk2Sj_JkM5ZNf_SHWw",
        "Content-Type": "application/json",
    }
    print("=" * 80)
    print(f"开始拉流: {start_id}")
    start_result = requests.get(start_url, headers=headers).json()
    print(
        f"START:: Device ID: {start_id}, Code: {start_result['code']}, Msg: {start_result['msg']}"
    )
    print(f"开始停止: {start_id}")
    time.sleep(3)

    stop_url = f"https://wvp.soft.cowarobot.com/api/play/stop/{start_id}/{start_id}"
    stop_result = requests.get(stop_url, headers=headers).json()
    print(
        f"STOP:: Device ID: {start_id}, Code: {stop_result['code']}, Msg: {stop_result['msg']}"
    )
    print(f"等待 3 秒开始下一个设备")
    time.sleep(3)

    start_id += 10
